//
//  BK_Account_Recharge_Cell.m
//  bestkeep
//
//  Created by TOPTEAM on 2017/2/23.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import "BK_Account_Recharge_Cell.h"
#import "BK_OD_Color.h"
#import "BK_OD_Tool.h"
@implementation BK_Account_Recharge_Cell
/**
 基类
 */

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //        self.separatorInset = UIEdgeInsetsMake(0, 0, 0, kOrderScreenWidth);
    }
    return self;
}

- (void)fillData:(id)data{
    
}

+ (CGFloat)computeHeight:(id)data{
    return 0;
}
@end




/**
 充值金额
 */
@implementation BKOrderBRAmountCell
{
    UILabel *_titleLabel;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initialize];
    }
    return self;
}

- (void)initialize
{
    _titleLabel = [[UILabel alloc] init];
    _titleLabel.font = UIFontLarge;
    _titleLabel.text = kOrderLocalizeString(@"BKOrderRechargeAmount");
    [self.contentView addSubview:_titleLabel];
    
    _amountTextField = [[UITextField alloc] init];
    _amountTextField.font = UIFontLarge;
    _amountTextField.borderStyle = UITextBorderStyleNone;
    _amountTextField.placeholder = @"请输入充值金额";
    _amountTextField.keyboardType = UIKeyboardTypeDecimalPad;
    [self.contentView addSubview:_amountTextField];
    
    [self makeConstraints];
}

- (void)makeConstraints
{
    CGSize textSize = [kOrderLocalizeString(@"BKOrderRechargeAmount") sizeWithAttributes:@{NSFontAttributeName : UIFontLarge}];
    
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView).offset(15);
        make.width.mas_equalTo(textSize.width);
        make.centerY.mas_equalTo(self.contentView);
    }];
    
    [_amountTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_titleLabel.mas_right).offset(40);
        make.right.mas_equalTo(self.contentView).offset(15);
        make.centerY.mas_equalTo(self.contentView);
    }];
}


+ (CGFloat)computeHeight:(id)data
{
    return 48;
}

@end


/**
 提示cell
 */
@implementation BKOrderBRPromptCell
{
    UILabel *_titleLabel;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initialize];
    }
    return self;
}

- (void)initialize
{
    self.backgroundColor = [UIColor clearColor];
    
    _titleLabel = [[UILabel alloc] init];
    _titleLabel.font = UIFontNormal;
    _titleLabel.text = kOrderLocalizeString(@"BKOrderRechargeTips");
    _titleLabel.textColor = kOrderLightGrey1;
    [self.contentView addSubview:_titleLabel];
    
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView).offset(15);
        make.centerY.mas_equalTo(self.contentView);
        make.right.mas_equalTo(self.contentView);
    }];
}

+ (CGFloat)computeHeight:(id)data
{
    return 40;
}

@end



/**
 充值方式
 */
@implementation BKOrderBRMethodCell
{
    UILabel *_titleLabel;
    UIImageView *_payLogoImg;
    UILabel *_payName;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initialize];
    }
    return self;
}

- (void)initialize
{
    _titleLabel = [[UILabel alloc] init];
    _titleLabel.font = UIFontLarge;
    _titleLabel.text = kOrderLocalizeString(@"BKOrderRechargeMethod");
    [self.contentView addSubview:_titleLabel];
    
    _payLogoImg = [[UIImageView alloc] init];
    _payLogoImg.image = [UIImage imageNamed:@"BKOrder_BR_ali_logo"];
    [self.contentView addSubview:_payLogoImg];
    
    _payName = [[UILabel alloc] init];
    _payName.font = UIFontLarge;
    _payName.text = @"支付宝";
    [self.contentView addSubview:_payName];
    
    [self makeConstraints];
}

- (void)makeConstraints
{
    CGSize textSize = [kOrderLocalizeString(@"BKOrderRechargeMethod") sizeWithAttributes:@{NSFontAttributeName : UIFontLarge}];
    
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView).offset(15);
        make.centerY.mas_equalTo(self.contentView);
        make.width.mas_equalTo(textSize.width);
    }];
    
    [_payLogoImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentView);
        make.left.mas_equalTo(_titleLabel.mas_right).offset(30);
        make.width.height.mas_equalTo(24);
    }];
    
    [_payName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_payLogoImg.mas_right).offset(20);
        make.centerY.mas_equalTo(self.contentView);
    }];
}

+ (CGFloat)computeHeight:(id)data
{
    return 48;
}
@end






